<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="com.cdshop.entity.User"
	import="com.cdshop.dao.UserDAO,com.cdshop.web.NavigatorService,com.cdshop.web.auth.AuthenticateService"%>
<jsp:useBean id="model" class="com.cdshop.mvc.RegisterPM"
	scope="request" />
<jsp:setProperty property="*" name="model" />
<%
	User user = new User();
	user.setUsername(model.getUsername());
	user.setNickname(model.getNickname());
	user.setPassword(model.getPassword());
	user.setEmail(model.getEmail());
	user.setSex(model.getSex());
	user.setBirthday(model.getBirthday());
	user.setRoles(model.getRoles());
	UserDAO.instance().create(user);
	
	AuthenticateService.instance().login(session,user.getUsername(),user.getPassword());
	
	NavigatorService.instance().forward(request, response,
			"/pages/info.jsp");
	return;
%>